package redigo

import (
	"fmt"
	"github.com/garyburd/redigo/redis"
)

func RedisTest() {
	c, err := redis.Dial("tcp", ":6379")
	if err != nil {
		fmt.Println(err)
	}
	defer c.Close()
	ret, err := c.Do("ZRANGE", "test", 0, 1)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(ret)
	fmt.Println(string(ret.([]interface{})[0].([]byte)))
	data, err := redis.Strings(ret, err)
	fmt.Println(data)

	fmt.Println(redis.StringMap(c.Do("ZRANGE", "test", 0, 1, "WITHSCORES")))
	fmt.Println(redis.StringMap(c.Do("ZRANGE", "test", "0", "1", "WITHSCORES")))
}
